package com.hieu.sms.persist;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.hieu.sms.model.Department;
import com.hieu.sms.model.Major;

@Repository
@Transactional
public class DepartmentDaoImpl extends
		AbstractHibernateDAOImpl<Department, Long> implements DepartmentDao {

	@Override
	protected Class<Department> getDomainClass() {
		return Department.class;
	}
	@SuppressWarnings("unchecked")
	public List<Major> findByDepId(String depId){
		Query query = getSession().getNamedQuery("Major.findByDepId").setString("depId", depId);
		return query.list();
	}

}
